Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CircleAvatar to support Material 3 #114812

Merged
merged 2 commits into from Nov 9, 2022

Conversation

TahaTesser
Copy link
Member

@TahaTesser TahaTesser commented Nov 7, 2022

fixes #114811

This PR updates CircleAvatar to support Material 3.

Screenshot 2022-11-07 at 15 31 08

Since there is no theme for the CircleAvatar, I just updated the default colors.
M3 Avatar size and font are the same as the current one.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Nov 7, 2022
@TahaTesser TahaTesser marked this pull request as ready for review November 7, 2022 14:47
Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, just needs one small change.

Color? effectiveBackgroundColor = backgroundColor;
final Color? effectiveForegroundColor = foregroundColor
?? (theme.useMaterial3 ? theme.colorScheme.onPrimaryContainer : null);
TextStyle textStyle = theme.primaryTextTheme.titleMedium!.copyWith(color: effectiveForegroundColor);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be using theme.textTheme here. primaryTextTheme, like primaryColorLight and primaryColorDark, are obsolete and will be deprecated when Material3 becomes the default.

Copy link
Member Author

@TahaTesser TahaTesser Nov 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to break the M2 default color. I will look into it.

theme.primaryTextTheme.titleMedium

Screenshot 2022-11-08 at 18 43 26

theme. textTheme.titleMedium

Screenshot 2022-11-08 at 18 43 39

@@ -306,6 +278,61 @@ void main() {
final RenderParagraph paragraph = tester.renderObject(find.text('Z'));
expect(paragraph.text.style!.color, equals(ThemeData.fallback().primaryColorLight));
});

group('Material 2', () {
// Tests that are only relevant for Material 2. Once ThemeData.useMaterial3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE

Copy link
Contributor

@HansMuller HansMuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HansMuller HansMuller merged commit d3dcd7d into flutter:master Nov 9, 2022
@TahaTesser TahaTesser deleted the m3_circle_avatar branch November 9, 2022 11:56
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Nov 9, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 9, 2022
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Nov 9, 2022
* a84e369bd Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26e2 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59ac [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f1c [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d23 Build command dependency injection (flutter/flutter#114383)

* 69a542dad Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed71 match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d53 Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
auto-submit bot pushed a commit to flutter/plugins that referenced this pull request Nov 9, 2022
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
IVLIVS-III pushed a commit to IVLIVS-III/flutter_plugins_fork that referenced this pull request Nov 11, 2022
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
percula pushed a commit to percula/packages that referenced this pull request Nov 17, 2022
…#2791)

* a84e369bd Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26e2 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59ac [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f1c [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d23 Build command dependency injection (flutter/flutter#114383)

* 69a542dad Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed71 match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d53 Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
adam-harwood pushed a commit to adam-harwood/flutter_plugins that referenced this pull request Nov 21, 2022
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
* a84e369 Revert "Allow Flutter golden file tests to be flaky (#114450)" (flutter/flutter#114902)

* 1725a26 Switch the way we retrieve the vm_service_port from /hub to iquery, on device. (flutter/flutter#114834)

* 7020f59 [tool] Support `--flavor` option for `flutter install`. (flutter/flutter#114048)

* 9797d5f [macOS] Refactor the `flutter run` macOS console output test (flutter/flutter#114645)

* 530324d Build command dependency injection (flutter/flutter#114383)

* 69a542d Apply multidex config in kotlin dsl gradle file (flutter/flutter#114660)

* 92f10ed match error statements without relying on volatile human-readable descriptions (flutter/flutter#114922)

* d3dcd7d Update `CircleAvatar` to support Material 3 (flutter/flutter#114812)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update CircleAvatar to support Material 3
2 participants